package com.zxc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
  * @author: zxc
  * @return:
  * @time:  2021/5/19 14:23
  * @description:
  */
@Controller
public class Demo2Controller {

    @RequestMapping("/test1")
    public String d1 () {
        System.out.println("跳转");
        //转发
        return "forward:/test2";
    }

    @RequestMapping("/test2")
    public String d2() {
        System.out.println("测试");
        return "demo";
    }

    @RequestMapping("/test3")
    public String d3 () {
        System.out.println("测试2");
        //重定向
        return "redirect:/index.jsp";
    }
}
